package com.dhy.socket.res;


import lombok.Builder;
import lombok.Data;


/**
 * @author 大忽悠
 */
@Data
@Builder
public class AjaxResponse {
    private Integer code;
    private Object data;

    public static AjaxResponse success(){
        return AjaxResponse.builder().code(200).build();
    }

    public static AjaxResponse success(Object data){
        return AjaxResponse.builder().code(200).data(data).build();
    }

    public static AjaxResponse error(){
        return AjaxResponse.builder().code(500).build();
    }
}